#!/usr/bin/env bash

source ./config/env.sh
clear

# 创建解压目录
mkdir -p ${K8S_DATA}/unpack/{flannel,docker,kubernetes}
cd ${K8S_DATA}/package


# cfssl install 
cp ${K8S_DATA}/package/cfssl-certinfo_linux-amd64 ${K8S_BIN_DIR}/cfssl-certinfo
cp ${K8S_DATA}/package/cfssljson_linux-amd64    ${K8S_BIN_DIR}/cfssljson
cp ${K8S_DATA}/package/cfssl_linux-amd64    ${K8S_BIN_DIR}/cfssl 

# docker-compose install
cp ${K8S_DATA}/package/docker-compose-Linux-x86_64 ${K8S_BIN_DIR}/docker-compose


# 解压所以的组件
tar -xzvf kubernetes-client-linux-amd64.tar.gz -C ${K8S_DATA}/unpack
tar -xzvf etcd-v3.3.12-linux-amd64.tar.gz -C ${K8S_DATA}/unpack
tar -xzvf flannel-v0.11.0-linux-amd64.tar.gz -C ${K8S_DATA}/unpack/flannel
tar -xzvf kubernetes-server-linux-amd64.tar.gz -C ${K8S_DATA}/unpack
tar -xzvf ${K8S_DATA}/unpack/kubernetes/kubernetes-src.tar.gz -C ${K8S_DATA}/unpack/kubernetes/
tar -xzvf heapster-1.5.4.tar.gz -C ${K8S_DATA}/unpack
tar -xzvf docker-18.09.3.tgz -C ${K8S_DATA}/unpack/docker
